
var vm = new Vue({
    el: "#headerVue",
    data: {
        searchs: '',
        login: true,
        logout: false,
        user_id:'',
        user_name:'',
        web_token:'',
        city:'',
        tel:'',
        email:''
    },
    methods: {
        req:function () {
            var url = '/userweb/Homepage/xhlData';
            var data = {
            };
            this.$http.post(url, data, {
                emulateJSON: true
            }).then(function (res) {
                if (res.data.status == 200) {
                    this.tel    = res.data.xhlData.tel;
                    this.email  = res.data.xhlData.email;
                } else {
                    layer.msg(res.data.msg,{
                        skin:'winning-class',
                        time:3000
                    });
                }
            }, function (res) {

            });
        }
    },
    mounted: function () {
        this.user_id        = localStorage.getItem('user_id');
        this.user_name      = localStorage.getItem('user_name');
        this.web_token      = localStorage.getItem('web_token');
        this.city           = localStorage.getItem('city');
        if (!this.city){
            this.city       = 'Devon County';
        }
        if (this.user_id){
            this.login  = false;
            this.logout = true;

        }else {
            this.login  = true;
            this.logout = false;
        }
        this.req();
    }
});